<template>
	<view class="manual">
		<view class="su-main">
			<view class="item item-b" v-for="(item, index) in setUpList" :key="index" @click="onSetUp(item, index)">
				<view class="left">{{ item.name }}</view>
				<view class="right"><image src="/static/xs_icon/right3.png" mode="widthFix"></image></view>
			</view>
		</view>

		<!-- <view class="pd-buttom"><view class="pdb-con" @click="onReturn()">退出登录</view></view> -->
	</view>
</template>

<script>
// import { mapState, mapMutations } from "vuex";
import { VERSION_CODE } from '@/common/config.js';
import successPop from '@/components/xs-components/success-pop/success-pop.vue';
export default {
	components: { successPop },
	data() {
		return {
			login: false,
			setUpList: [
				// { name: '如何修改手机号？', id: '0' },
				// { name: '如何修改密码？', id: '1' },
				// { name: '如何模拟考试？', id: '2' },
				// { name: '如何查看错题库？', id: '3' },
				// { name: '如何预约考试？', id: '4' }
			],
			showPopup: false // 清除成功弹窗
		};
	},
	onLoad() {
		this.into();
	},
	methods: {
		// ...mapMutations(['getAddress','auoutUS']),
		into() {
			this.postData();
			// this.aboutUS();
		},
		// 获取数据
		postData() {
			this.$api
				.post(global.apiUrls.manual)
				.then(res => {
					console.log(res);
					this.setUpList = res.data.data;
				})
				.catch(err => {
					// this.$popup.showToast('保存失败')
				});
		},
		// 列表点击事件
		onSetUp(item, index) {
			console.log(item, index);
			// item.id 0 如何修改手机号 1 如何修改密码 2 如何模拟考试 3 如何查看错题库 4 如何预约考试
			uni.navigateTo({
				url: '../manualDetails/manualDetails?title=' + item.name + '&id=' + item.id
			});
		}
	}
};
</script>

<style lang="scss">
@import './manual.scss';
</style>
